home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / SRC / GEMLIB38.LZH / x_nvdi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-11  |  30.8 KB  |  1,413 lines

  1. /*
  2.  * All functions of NVDI 2.x, 3.x, 4.x, 5.x
  3.  *
  4. */
  5. #include "gemx.h"
  6.  
  7. /*
  8.  * The following functions requires EdDI version 1.x or higher
  9. */
  10. void v_clsbm(int handle)
  11. {
  12.     vdi_control[0] = 101;
  13.     vdi_control[1] = 0;
  14.     vdi_control[3] = 0;
  15.     vdi_control[5] = 1;
  16.     vdi_control[6] = handle;
  17.     vdi(&vdi_params);
  18. }
  19.  
  20. void v_opnbm(int *work_in, MFDB *bitmap, int *handle, int *work_out)
  21. {
  22. #ifndef __MSHORT__
  23.     register int    i;
  24.  
  25.     for (i = 0; i<20; i++)
  26.         vdi_intin[i] = work_in[i];
  27. #else
  28.     vdi_params.intin = (short *)&work_in[0];
  29.     *((MFDB **)(&vdi_control[7])) = bitmap;
  30.     vdi_params.intout = (short *)&work_out[0];
  31.     vdi_params.ptsout = (short *)&work_out[45];
  32. #endif
  33.  
  34.     *((MFDB **)(&vdi_control[7])) = bitmap;
  35.  
  36.     vdi_control[0] = 100;
  37.     vdi_control[1] = 0;
  38.     vdi_control[3] = 20;
  39.     vdi_control[5] = 1;
  40.     vdi_control[6] = *handle;
  41.     vdi(&vdi_params);
  42.  
  43. #ifndef __MSHORT__
  44.     for (i = 0; i<45; i++)
  45.         work_out[i] = vdi_intout[i];
  46.     for (i = 0; i<12; i++)
  47.         work_out[i+45] = vdi_ptsout[i];
  48. #else
  49.     vdi_params.intin = &vdi_intin[0];
  50.     vdi_params.intout = &vdi_intout[0];
  51.     vdi_params.ptsout = &vdi_ptsout[0];
  52. #endif
  53.     *handle = vdi_control[6];
  54. }
  55.  
  56. void vq_scrninfo(int handle, int *work_out)
  57. {
  58. #ifndef __MSHORT__
  59.     register short    i;
  60. #else
  61.     vdi_params.intout = (short *)&work_out[0];
  62. #endif
  63.  
  64.     vdi_intin[0] = 2;
  65.     vdi_control[0] = 102;
  66.     vdi_control[1] = 0;
  67.     vdi_control[3] = 1;
  68.     vdi_control[5] = 1;
  69.     vdi_control[6] = handle;
  70.     vdi(&vdi_params);
  71.  
  72. #ifndef __MSHORT__
  73.     for (i = 0; i<273; i++)
  74.         work_out[i] = vdi_intout[i];
  75. #else
  76.     vdi_params.intout = &vdi_intout[0];
  77. #endif
  78. }
  79.  
  80.  
  81. /*
  82.  * The following functions requires NVDI version 2.x or higher
  83. */
  84. int v_bez_on(int handle)
  85. {
  86.     vdi_control[0] = 11;
  87.     vdi_control[1] = 1;
  88.     vdi_control[3] = 0;
  89.     vdi_control[5] = 13;
  90.     vdi_control[6] = handle;
  91.     vdi(&vdi_params);
  92.     return vdi_intout[0];
  93. }
  94.  
  95. void v_bez_off(int handle)
  96. {
  97.     vdi_control[0] = 11;
  98.     vdi_control[1] = 0;
  99.     vdi_control[3] = 0;
  100.     vdi_control[5] = 13;
  101.     vdi_control[6] = handle;
  102.     vdi(&vdi_params);
  103. }
  104.  
  105. static void _v_bez(int ctrl0, int handle, int count, int  *xyarr, char *bezarr, int *extent, int *totpts, int *totmoves)
  106. {
  107.     short    *end;
  108.     char    *pbd = bezarr;
  109.     char    *opbd = (char *)vdi_intin;
  110.     short    *optr;
  111.  
  112.     end = (short *)(pbd + count);
  113.     while (pbd < (char *)end)
  114.     {
  115.         *(opbd + 1) = *pbd++;
  116.         if (pbd >= (char *)end)
  117.             break;
  118.         *opbd = *pbd++;
  119.         opbd += 2;
  120.     }
  121.     optr = vdi_ptsin;
  122.     end    = optr + count + count;
  123.     while (optr < end)
  124.         *optr++ = *xyarr++;
  125.  
  126.     vdi_control[0] = ctrl0;
  127.     vdi_control[1] = count;
  128.     vdi_control[3] = ((count + 1) >> 1);
  129.     vdi_control[5] = 13;
  130.     vdi_control[6] = handle;
  131.     vdi(&vdi_params);
  132.  
  133.     extent[0] = vdi_ptsout[0];
  134.     extent[1] = vdi_ptsout[1];
  135.     extent[2] = vdi_ptsout[2];
  136.     extent[3] = vdi_ptsout[3];
  137.     *totpts = vdi_intout[0];
  138.     *totmoves = vdi_intout[1];
  139. }
  140.  
  141. void v_bez(int handle, int count, int *xyarr, char *bezarr, int *extent, int *totpts, int *totmoves)
  142. {
  143.     _v_bez(6, handle, count, xyarr, bezarr, extent, totpts, totmoves);
  144. }
  145.  
  146. void v_bez_fill(int handle, int count, int *xyarr, char *bezarr, int *extent, int *totpts, int *totmoves)
  147. {
  148.     _v_bez(9, handle, count, xyarr, bezarr, extent, totpts, totmoves);
  149. }
  150.  
  151. void v_bez_qual(int handle, int percent, int *actual)
  152. {
  153.     vdi_intin[0] = 32;
  154.     vdi_intin[1] = 1;
  155.     vdi_intin[2] = percent;
  156.     vdi_control[0] = 5;
  157.     vdi_control[1] = 0;
  158.     vdi_control[3] = 3;
  159.     vdi_control[5] = 99;
  160.     vdi_control[6] = handle;
  161.     vdi(&vdi_params);
  162.     *actual = vdi_intout[0];
  163. }
  164.  
  165.  
  166. /*
  167.  * The following functions requires NVDI version 3.x or higher
  168. */
  169. void v_ftext(int handle, int x, int y, char *str)
  170. {
  171.     short i;
  172.  
  173.     i = vdi_str2array(str, vdi_intin);
  174.     vdi_ptsin[0] = x;
  175.     vdi_ptsin[1] = y;
  176.  
  177.     vdi_control[0] = 241;
  178.     vdi_control[1] = 2;
  179.     vdi_control[3] = i;
  180.     vdi_control[6] = handle;
  181.     vdi(&vdi_params);
  182. }
  183.  
  184. void v_ftext_offset(int handle, int x, int y, char *str, int *offset)
  185. {
  186.     short *ptr = vdi_intin;
  187.     short i;
  188.  
  189.     i = vdi_str2array(str, vdi_intin);
  190.     vdi_ptsin[0] = x;
  191.     vdi_ptsin[1] = y;
  192.     ptr = &vdi_ptsin[2];
  193.     for(i *= 2; i > 0; i--)
  194.         *ptr++ = *offset++;
  195.  
  196.     vdi_control[0] = 241;
  197.     vdi_control[1] = 1 + i;
  198.     vdi_control[3] = i;
  199.     vdi_control[6] = handle;
  200.     vdi(&vdi_params);
  201. }
  202.  
  203. void v_getbitmap_info(int handle, int ch, long *advancex, long *advancey,
  204.                             long *xoffset, long *yoffset, int *width, int *height,
  205.                             short **bitmap)
  206. {
  207.     vdi_intin[0] = ch;
  208.     vdi_control[0] = 239;
  209.     vdi_control[1] = 0;
  210.     vdi_control[3] = 1;
  211.     vdi_control[5] = 0;
  212.     vdi_control[6] = handle;
  213.     vdi(&vdi_params);
  214.     *width = vdi_intout[0];
  215.     *height = vdi_intout[1];
  216.     *advancex = *((long *)(&vdi_intout[2]));
  217.     *advancey = *((long *)(&vdi_intout[4]));
  218.     *xoffset = *((long *)(&vdi_intout[6]));
  219.     *yoffset = *((long *)(&vdi_intout[8]));
  220.     *bitmap = *((short **)(&vdi_intout[10]));
  221. }
  222.  
  223. void v_getoutline(int handle, int ch, int *xyarray, char *bezarray, int maxverts, int *numverts)
  224. {
  225.     vdi_intin[0] = ch;
  226.     vdi_intin[1] = maxverts;
  227.     *((int **)(&vdi_intin[2])) = xyarray;
  228.     *((char **)(&vdi_intin[4])) = bezarray;
  229.     vdi_control[0] = 243;
  230.     vdi_control[1] = 0;
  231.     vdi_control[3] = 6;
  232.     vdi_control[6] = handle;
  233.     vdi(&vdi_params);
  234.     *numverts = vdi_intout[0];
  235. }
  236.  
  237. void vq_devinfo(int handle, int device, int *dev_open, char *file_name, char *device_name)
  238. {
  239.     short    len, i;
  240.  
  241.     vdi_intin[0] = device;
  242.     vdi_control[0] = 248;
  243.     vdi_control[1] = 0;
  244.     vdi_control[3] = 1;
  245.     vdi_control[5] = 0;
  246.     vdi_control[6] = handle;
  247.     vdi(&vdi_params);
  248.     vdi_array2str(vdi_intout, file_name, vdi_control[4]);
  249.     *dev_open = vdi_ptsout[0];
  250.  
  251.     /* Name in ptsout als C-String, d.h. pro ptsout[] 2 Buchstaben!! */
  252.     if ((vdi_control[2] == 1 ) && (vdi_control[1] > 0 )) /* steht so in NVDI4-Doku */
  253.         len = vdi_control[1];
  254.     else
  255.         len = vdi_control[2] - 1;
  256.     for (i = 1; i <= len; i++)
  257.         *((short *)device_name)++ = vdi_ptsout[i];
  258.     *device_name++ = 0;
  259. }
  260.  
  261. int vq_ext_devinfo (int handle, int device, int *dev_exists,
  262.                             char *file_path, char *file_name, char *name)
  263. {
  264.     vdi_intin[0] = device;
  265.     *((char **)(&vdi_intin[1])) = file_path;
  266.     *((char **)(&vdi_intin[3])) = file_name;
  267.     *((char **)(&vdi_intin[5])) = name;
  268.     vdi_control[0] = 248;
  269.     vdi_control[1] = 0;
  270.     vdi_control[3] = 7;
  271.     vdi_control[5] = 4242;
  272.     vdi_control[6] = handle;
  273.     vdi(&vdi_params);
  274.     *dev_exists = vdi_intout[0];
  275.     return vdi_intout[1];
  276. }
  277.  
  278. void vqt_advance(int handle, int ch, long *advx, long *advy)
  279. {
  280.     vdi_intin[0] = ch;
  281.     vdi_control[0] = 247;
  282.     vdi_control[1] = 0;
  283.     vdi_control[3] = 2;
  284.     vdi_control[5] = 0;
  285.     vdi_control[6] = handle;
  286.     vdi(&vdi_params);
  287.     *advx = *((long *)(&vdi_ptsout[4]));
  288.     *advy = *((long *)(&vdi_ptsout[6]));
  289. }
  290.  
  291. int vqt_ext_name (int handle, int index, char *name, int *font_format, int *flags)
  292. {
  293.     vdi_intin[0] = index;
  294.     vdi_intin[1] = 0;
  295.     vdi_control[0] = 130;
  296.     vdi_control[1] = 0;
  297.     vdi_control[3] = 2;
  298.     vdi_control[5] = 1;
  299.     vdi_control[6] = handle;
  300.     vdi(&vdi_params);
  301.     vdi_array2str(vdi_intout+1, name, 32);
  302.     name[32]    = vdi_intout[33];
  303.     *flags = (vdi_intout[34] >> 8) & 0xff;
  304.     *font_format = vdi_intout[34] & 0xff;
  305.      return vdi_intout[0];
  306. }
  307.  
  308. void vqt_f_extent(int handle, char *str, int extent[])
  309. {
  310.     short    i;
  311.  
  312.     i = vdi_str2array(str, vdi_intin);
  313.     vdi_control[0] = 240;
  314.     vdi_control[1] = 0;
  315.     vdi_control[3] = i;
  316.     vdi_control[6] = handle;
  317.     vdi(&vdi_params);
  318.  
  319.     for (i = 0; i<8; i++)
  320.         extent[i] = vdi_ptsout[i];
  321. }
  322.  
  323. void vqt_fontheader(int handle, char *buffer, char *pathname)
  324. {
  325.     *((char **)(&vdi_intin[0])) = buffer;
  326.      vdi_control[0] = 232;
  327.     vdi_control[1] = 0;
  328.     vdi_control[3] = 2;
  329.     vdi_control[5] = 0;
  330.     vdi_control[6] = handle;
  331.     vdi(&vdi_params);
  332.     vdi_array2str(vdi_intout, pathname, vdi_control[4]);
  333. }
  334.  
  335. int vqt_name_and_id (int handle, int font_format, char *font_name, char *ret_name)
  336. {
  337.     short    i;
  338.  
  339.     vdi_intin[0] = font_format;
  340.     i = vdi_str2array(font_name, vdi_intin);
  341.      vdi_control[0] = 230;
  342.     vdi_control[1] = 0;
  343.     vdi_control[3] = i;
  344.     vdi_control[5] = 100;
  345.     vdi_control[6] = handle;
  346.     vdi(&vdi_params);
  347.     vdi_array2str(vdi_intin, ret_name, vdi_control[4]);
  348.     return vdi_intout[0];
  349. }
  350.  
  351. void vqt_pairkern(int handle, int ch1, int ch2, long *x, long *y)
  352. {
  353.     vdi_intin[0] = ch1;
  354.     vdi_intin[1] = ch2;
  355.      vdi_control[0] = 235;
  356.     vdi_control[1] = 0;
  357.     vdi_control[3] = 2;
  358.     vdi_control[5] = 0;
  359.     vdi_control[6] = handle;
  360.     vdi(&vdi_params);
  361.     *x = *((long *)(&vdi_ptsout[0]));
  362.     *y = *((long *)(&vdi_ptsout[2]));
  363. }
  364.  
  365. void vqt_real_extent(int handle, int x, int y, char *string, int extent[])
  366. {
  367.     short    i;
  368.  
  369.     i = vdi_str2array(string, vdi_intin);
  370.     vdi_ptsin[0] = x;
  371.     vdi_ptsin[1] = y;
  372.     vdi_control[0] = 240;
  373.     vdi_control[1] = 1;
  374.     vdi_control[3] = i;
  375.     vdi_control[6] = handle;
  376.     vdi(&vdi_params);
  377.     for (i = 0; i<8; i++)
  378.         extent[i] = vdi_ptsout[i];
  379. }
  380.  
  381. void vqt_trackkern(int handle, long *x, long *y)
  382. {
  383.      vdi_control[0] = 234;
  384.     vdi_control[1] = 0;
  385.     vdi_control[3] = 0;
  386.     vdi_control[5] = 0;
  387.     vdi_control[6] = handle;
  388.     vdi(&vdi_params);
  389.     *x = *((long *)(&vdi_ptsout[0]));
  390.     *y = *((long *)(&vdi_ptsout[2]));
  391. }
  392.  
  393. int vqt_xfntinfo(int handle, int flags, int id, int index, XFNT_INFO *info)
  394. {
  395.     info->size = (long) sizeof(XFNT_INFO);
  396.     vdi_intin[0] = flags;
  397.     vdi_intin[1] = id;
  398.     vdi_intin[2] = index;
  399.     *((XFNT_INFO **)(&vdi_intin[3])) = info;
  400.     vdi_control[0] = 229;
  401.     vdi_control[1] = 0;
  402.     vdi_control[3] = 5;
  403.     vdi_control[5] = 0;
  404.     vdi_control[6] = handle;
  405.     vdi(&vdi_params);
  406.     return vdi_intout[1];
  407. }
  408.  
  409. long vst_arbpt(int handle, long point, int *wchar, int *hchar, int *wcell, int *hcell)
  410. {
  411.     *((long *)(&vdi_intin[0])) = point;
  412.     vdi_control[0] = 246;
  413.     vdi_control[1] = 0;
  414.     vdi_control[3] = 2;
  415.     vdi_control[6] = handle;
  416.     vdi(&vdi_params);
  417.     *wchar = vdi_ptsout[0];
  418.     *hchar = vdi_ptsout[1];
  419.     *wcell = vdi_ptsout[2];
  420.     *hcell = vdi_ptsout[3];
  421.     return *((long *)(&vdi_intout[0]));
  422. }
  423.  
  424. int vst_charmap(int handle, int mode)
  425. {
  426.     vdi_intin[0] = mode;
  427.     vdi_intin[1] = 1;
  428.     vdi_control[0] = 236;
  429.     vdi_control[1] = 0;
  430.     vdi_control[3] = 2;
  431.     vdi_control[6] = handle;
  432.     vdi(&vdi_params);
  433.     return (int)vdi_intout[0];
  434. }
  435.  
  436. void vst_kern(int handle, int tmode, int pmode, int *tracks, int *pairs)
  437. {
  438.     vdi_intin[0] = tmode;
  439.     vdi_intin[1] = pmode;
  440.     vdi_control[0] = 237;
  441.     vdi_control[1] = 0;
  442.     vdi_control[3] = 2;
  443.     vdi_control[6] = handle;
  444.     vdi(&vdi_params);
  445.     *tracks = vdi_intout[0];
  446.     *pairs = vdi_intout[1];
  447. }
  448.  
  449. int vst_name(int handle, int font_format, char *font_name, char *ret_name)
  450. {
  451.     short    i;
  452.  
  453.     vdi_intin[0] = font_format;
  454.     i = vdi_str2array(font_name, vdi_intin+1);
  455.     vdi_control[0] = 230;
  456.     vdi_control[1] = 0;
  457.     vdi_control[3] = i;
  458.     vdi_control[5] = 0;
  459.     vdi_control[6] = handle;
  460.     vdi(&vdi_params);
  461.     vdi_array2str(vdi_intout, ret_name, vdi_control[4]);
  462.     return vdi_intout[0];
  463. }
  464.  
  465. long vst_setsize(int handle, long point, int *wchar, int *hchar, int *wcell, int *hcell)
  466. {
  467.     *((long *)(&vdi_intin[0])) = point;
  468.     vdi_control[0] = 252;
  469.     vdi_control[1] = 0;
  470.     vdi_control[3] = 2;
  471.     vdi_control[6] = handle;
  472.     vdi(&vdi_params);
  473.     *wchar = vdi_ptsout[0];
  474.     *hchar = vdi_ptsout[1];
  475.     *wcell = vdi_ptsout[2];
  476.     *hcell = vdi_ptsout[3];
  477.     return *((long *)(&vdi_intout[0]));
  478. }
  479.  
  480. int vst_skew(int handle, int skew)
  481. {
  482.     vdi_intin[0] = skew;
  483.     vdi_control[0] = 253;
  484.     vdi_control[1] = 0;
  485.     vdi_control[3] = 1;
  486.     vdi_control[6] = handle;
  487.     vdi(&vdi_params);
  488.     return vdi_intout[0];
  489. }
  490.  
  491. void vst_track_offset(int handle, long offset, int pairmode, int *tracks, int *pairs)
  492. {
  493.     vdi_intin[0] = 255;
  494.     vdi_intin[1] = pairmode;
  495.     *((long *)(&vdi_intin[2])) = offset;
  496.     vdi_control[0] = 237;
  497.     vdi_control[1] = 0;
  498.     vdi_control[3] = 4;
  499.     vdi_control[6] = handle;
  500.     vdi(&vdi_params);
  501.     *tracks = vdi_intout[0];
  502.     *pairs  = vdi_intout[1];
  503. }
  504.  
  505. void vst_width(int handle, int width, int *char_width, int *char_height, int *cell_width, int *cell_height)
  506. {
  507.     vdi_ptsin[0] = width;
  508.     vdi_control[0] = 231;
  509.     vdi_control[1] = 1;
  510.     vdi_control[3] = 0;
  511.     vdi_control[6] = handle;
  512.     vdi(&vdi_params);
  513.     *char_width  = vdi_ptsout[0];
  514.     *char_height = vdi_ptsout[1];
  515.     *cell_width  = vdi_ptsout[2];
  516.     *cell_height = vdi_ptsout[3];
  517. }
  518.  
  519.  
  520.  
  521. /*
  522.  * The following functions requires NVDI version 4.x or higher
  523. */
  524. int vqt_char_index(int handle, int scr_index, int scr_mode, int dst_mode)
  525. {
  526.     vdi_intin[0] = scr_index;
  527.     vdi_intin[1] = scr_mode;
  528.     vdi_intin[2] = dst_mode;
  529.     vdi_control[0] = 190;
  530.     vdi_control[1] = 0;
  531.     vdi_control[3] = 3;
  532.     vdi_control[5] = 0;
  533.     vdi_control[6] = handle;
  534.     vdi(&vdi_params);
  535.     return vdi_intout[0];
  536. }
  537.  
  538.  
  539. /*
  540.  * The following functions requires NVDI version 5.x or higher
  541. */
  542. long v_color2nearest(int handle, long color_space, COLOR_ENTRY *color, COLOR_ENTRY *nearest_color)
  543. {
  544.     *(long *) &vdi_intin[0] = color_space;
  545.     *(COLOR_ENTRY *) &vdi_intin[2] = *color;
  546.  
  547.     vdi_control[0] = 204;
  548.     vdi_control[1] = 0;
  549.     vdi_control[3] = 6;
  550.     vdi_control[5] = 2;
  551.     vdi_control[6] = handle;
  552.     vdi(&vdi_params);
  553.  
  554.     *nearest_color = *(COLOR_ENTRY *) &vdi_intout[2];
  555.     return (*(long*) &vdi_intout[0]);
  556. }
  557.  
  558. unsigned long v_color2value(int handle, long color_space, COLOR_ENTRY *color)
  559. {
  560.     *(long *) &vdi_intin[0] = color_space;
  561.     *(COLOR_ENTRY *) &vdi_intin[2] = *color;
  562.  
  563.     vdi_control[0] = 204;
  564.     vdi_control[1] = 0;
  565.     vdi_control[3] = 6;
  566.     vdi_control[5] = 0;
  567.     vdi_control[6] = handle;
  568.     vdi(&vdi_params);
  569.  
  570.     return (*(unsigned long*)&vdi_intout[0]);
  571. }
  572.  
  573. COLOR_TAB *v_create_ctab(int handle, long color_space, unsigned long px_format)
  574. {
  575.     *(long *) &vdi_intin[0] = color_space;
  576.     *(unsigned long *) &vdi_intin[2] = px_format;
  577.  
  578.     vdi_control[0] = 206;
  579.     vdi_control[1] = 0;
  580.     vdi_control[3] = 4;
  581.     vdi_control[5] = 8;
  582.     vdi_control[6] = handle;
  583.     vdi(&vdi_params);
  584.  
  585.     return (*(COLOR_TAB **) &vdi_intout[0]);                            
  586. }
  587.  
  588. ITAB_REF    v_create_itab( int handle, COLOR_TAB *ctab, int bits )
  589. {
  590.     *(COLOR_TAB **) &vdi_intin[0] = ctab;
  591.     vdi_intin[2] = bits;
  592.     vdi_intin[3] = 0;
  593.     vdi_intin[4] = 0;
  594.  
  595.     vdi_control[0] = 208;
  596.     vdi_control[1] = 0;
  597.     vdi_control[3] = 5;
  598.     vdi_control[5] = 0;
  599.     vdi_control[6] = handle;
  600.     vdi(&vdi_params);
  601.  
  602.     return (*(ITAB_REF *) &vdi_intout[0]);
  603. }
  604.  
  605. unsigned long    v_ctab_idx2value( int handle, int index )
  606. {
  607.     vdi_intin[0] = index;
  608.  
  609.     vdi_control[0] = 206;
  610.     vdi_control[1] = 0;
  611.     vdi_control[3] = 1;
  612.     vdi_control[5] = 5;
  613.     vdi_control[6] = handle;
  614.     vdi(&vdi_params);
  615.  
  616.     return (*(unsigned long *) &vdi_intout[0]);                                
  617. }
  618.  
  619. int v_ctab_idx2vdi(int handle, int index)
  620. {
  621.     vdi_intin[0] = index;
  622.     vdi_control[0] = 206;
  623.     vdi_control[1] = 0;
  624.     vdi_control[3] = 1;
  625.     vdi_control[5] = 3;
  626.     vdi_control[6] = handle;
  627.     vdi(&vdi_params);
  628.  
  629.     return vdi_intout[0];
  630. }
  631.  
  632. int v_ctab_vdi2idx(int handle, int vdi_index)
  633. {
  634.     vdi_intin[0] = vdi_index;
  635.  
  636.     vdi_control[0] = 206;
  637.     vdi_control[1] = 0;
  638.     vdi_control[3] = 1;
  639.     vdi_control[5] = 4;
  640.     vdi_control[6] = handle;
  641.     vdi(&vdi_params);
  642.  
  643.     return vdi_intout[0];                                                    
  644. }
  645.  
  646. int v_delete_ctab(int handle, COLOR_TAB *ctab)
  647. {
  648.     *(COLOR_TAB **) &vdi_intin[0] = ctab;
  649.  
  650.     vdi_control[0] = 206;
  651.     vdi_control[1] = 0;
  652.     vdi_control[3] = 2;
  653.     vdi_control[5] = 9;
  654.     vdi_control[6] = handle;
  655.     vdi(&vdi_params);
  656.  
  657.     return vdi_intout[0];
  658. }
  659.  
  660. int v_delete_itab(int handle, ITAB_REF itab)
  661. {
  662.     *(ITAB_REF *) &vdi_intin[0] = itab;
  663.  
  664.     vdi_control[0] = 208;
  665.     vdi_control[1] = 0;
  666.     vdi_control[3] = 2;
  667.     vdi_control[5] = 1;
  668.     vdi_control[6] = handle;
  669.     vdi(&vdi_params);
  670.  
  671.     return vdi_intout[0];
  672. }
  673.  
  674. long v_get_ctab_id(int handle)
  675. {
  676.     vdi_control[0] = 206;
  677.     vdi_control[1] = 0;
  678.     vdi_control[3] = 0;
  679.     vdi_control[5] = 6;
  680.     vdi_control[6] = handle;
  681.     vdi(&vdi_params);
  682.  
  683.     return (*(long *) &vdi_intout[0]);
  684. }
  685.  
  686. int v_get_outline(int handle, int index, int x_offset, int y_offset, short *pts, char *flags, int max_pts)
  687. {
  688.     vdi_intin[0] = index;
  689.     vdi_intin[1] = max_pts;
  690.     *(short **) &vdi_intin[2] = pts;
  691.     *(char **) &vdi_intin[4] = flags;
  692.     vdi_intin[6] = x_offset;
  693.     vdi_intin[7] = y_offset;
  694.  
  695.     vdi_control[0] = 243;
  696.     vdi_control[1] = 0;
  697.     vdi_control[3] = 8;
  698.     vdi_control[5] = 1;
  699.     vdi_control[6] = handle;
  700.     vdi(&vdi_params);
  701.  
  702.     return vdi_intout[0];
  703. }
  704.  
  705. int v_open_bm(int base_handle, GCBITMAP *bitmap, int color_flags, int unit_flags, int pixel_width, int pixel_height)
  706. {
  707.     vdi_intin[0] = color_flags;
  708.     vdi_intin[1] = unit_flags;
  709.     vdi_intin[2] = pixel_width;
  710.     vdi_intin[3] = pixel_height;
  711.  
  712.     vdi_control[0] = 100;
  713.     vdi_control[1] = 0;
  714.     vdi_control[3] = 4;
  715.     vdi_control[5] = 3;
  716.     vdi_control[6] = base_handle;
  717.     *(GCBITMAP **) &vdi_control[7] = bitmap;
  718.     vdi(&vdi_params);
  719.  
  720.     return vdi_control[6];
  721. }
  722.  
  723. int v_opnprn(int aes_handle, PRN_SETTINGS *settings, int work_out[])
  724. {
  725.     register int    i;
  726.  
  727.     vdi_intin[0] = settings->driver_id;
  728.     for(i = 1; i < 10; i++)
  729.         vdi_intin[i] = 1;
  730.     vdi_intin[10] = 2;
  731.     vdi_intin[11] = settings->size_id;
  732.  
  733.     *(char **)&vdi_intin[12] = settings->device;
  734.     *(PRN_SETTINGS **)&vdi_intin[14] = settings;
  735.  
  736. #ifdef __MSHORT___
  737.     vdi_params.intout = &work_out[0];
  738.     vdi_params.ptsout = &work_out[45];
  739. #endif
  740.  
  741.     vdi_control[0] = 1;
  742.     vdi_control[1] = 0;
  743.     vdi_control[3] = 16;
  744.     vdi_control[5] = 0;
  745.     vdi_control[6] = aes_handle;
  746.     vdi(&vdi_params);
  747.  
  748. #ifdef __MSHORT___
  749.     vdi_params.intout = (void *)&vdi_intout[0];
  750.     vdi_params.ptsout = (void *)&vdi_ptsout[0];
  751. #else
  752.     for (i = 0; i<45; i++)
  753.         work_out[i] = vdi_intout[i];
  754.     for (i = 0; i<12; i++)
  755.         work_out[i+45] = vdi_ptsout[i];
  756. #endif
  757.     return vdi_control[6];
  758. }
  759.  
  760. int v_resize_bm(int handle, int width, int height, long byte_width, unsigned char *addr)
  761. {
  762.     vdi_intin[0] = width;
  763.     vdi_intin[1] = height;
  764.     *(long *) &vdi_intin[2] = byte_width;
  765.     *(unsigned char **) &vdi_intin[4] = addr;
  766.  
  767.     vdi_control[0] = 100;
  768.     vdi_control[1] = 0;
  769.     vdi_control[3] = 6;
  770.     vdi_control[5] = 2;
  771.     vdi_control[6] = handle;
  772.     vdi(&vdi_params);
  773.     return vdi_intout[0];
  774. }
  775.  
  776. void v_setrgb(int handle, int type, int r, int g, int b)
  777. {
  778.     vdi_intin[0] = r;
  779.     vdi_intin[1] = g;
  780.     vdi_intin[2] = b;
  781.  
  782.     vdi_control[0] = 138;
  783.     vdi_control[1] = 0;
  784.     vdi_control[3] = 3;
  785.     vdi_control[5] = type;
  786.     vdi_control[6] = handle;
  787.     vdi(&vdi_params);
  788. }
  789.  
  790. long v_value2color(int handle, unsigned long value, COLOR_ENTRY *color)
  791. {
  792.     *(unsigned long *)&vdi_intin[0] = value;
  793.     vdi_control[0] = 204;
  794.     vdi_control[1] = 0;
  795.     vdi_control[3] = 2;
  796.     vdi_control[5] = 1;
  797.     vdi_control[6] = handle;
  798.     vdi(&vdi_params);
  799.  
  800.     *color = *(COLOR_ENTRY *) &vdi_intout[2];
  801.     return (*(long*) &vdi_intout[0]);
  802. }
  803.  
  804. int vq_ctab(int handle, long ctab_length, COLOR_TAB *ctab)
  805. {
  806.     *(long *) &vdi_intin[0] = ctab_length;
  807.     vdi_params.intout = (short *)ctab;
  808.     vdi_control[0] = 206;
  809.     vdi_control[1] = 0;
  810.     vdi_control[3] = 2;
  811.     vdi_control[5] = 0;
  812.     vdi_control[6] = handle;
  813.     vdi(&vdi_params);
  814.  
  815.     vdi_params.intout = vdi_intout;
  816.  
  817.     if (vdi_control[4])
  818.         return 1;
  819.     else
  820.         return 0;
  821. }
  822.  
  823. long vq_ctab_entry(int handle, int index, COLOR_ENTRY *color)
  824. {
  825.     vdi_intin[0] = index;
  826.  
  827.     vdi_control[0] = 206;
  828.     vdi_control[1] = 0;
  829.     vdi_control[3] = 1;
  830.     vdi_control[5] = 1;
  831.     vdi_control[6] = handle;
  832.     vdi(&vdi_params);
  833.  
  834.     *color = *(COLOR_ENTRY *) &vdi_intout[2];
  835.     return (*(long*) &vdi_intout[0]);
  836. }
  837.  
  838. long vq_ctab_id(int handle)
  839. {
  840.     vdi_control[0] = 206;
  841.     vdi_control[1] = 0;
  842.     vdi_control[3] = 0;
  843.     vdi_control[5] = 2;
  844.     vdi_control[6] = handle;
  845.     vdi(&vdi_params);
  846.  
  847.     return (*(long*) &vdi_intout[0]);
  848. }
  849.  
  850. int vq_dflt_ctab(int handle, long ctab_length, COLOR_TAB *ctab)
  851. {
  852.     *(long *) &vdi_intin[0] = ctab_length;                                
  853.     vdi_params.intout = (short *)ctab;                                        
  854.     
  855.     vdi_control[0] = 206;
  856.     vdi_control[1] = 0;
  857.     vdi_control[3] = 2;
  858.     vdi_control[5] = 7;
  859.     vdi_control[6] = handle;
  860.     vdi(&vdi_params);
  861.  
  862.     vdi_params.intout = vdi_intout;                                    
  863.  
  864.     if (vdi_control[4])
  865.         return 1;
  866.     else
  867.         return 0;
  868. }
  869.  
  870. long vq_hilite_color(int handle, COLOR_ENTRY *hilite_color)
  871. {
  872.     vdi_control[0] = 209;
  873.     vdi_control[1] = 0;
  874.     vdi_control[3] = 0;
  875.     vdi_control[5] = 0;
  876.     vdi_control[6] = handle;
  877.     vdi( &vdi_params );
  878.  
  879.     *hilite_color = *(COLOR_ENTRY *) &vdi_intout[2];
  880.     return( *(long *) vdi_intout );
  881. }
  882.  
  883. int vq_margins(int handle, int *top_margin, int *bottom_margin, int *left_margin, int *right_margin, int *hdpi, int *vdpi)
  884. {
  885.     vdi_intout[0] = 0;
  886.     
  887.     vdi_control[0] = 5;     
  888.     vdi_control[1] = 0;
  889.     vdi_control[3] = 0;
  890.     vdi_control[5] = 2100;
  891.     vdi_control[6] = handle;    
  892.     vdi(&vdi_params);
  893.     
  894.     *top_margin = vdi_intout[1];                                            
  895.     *bottom_margin = vdi_intout[2];                                        
  896.     *left_margin = vdi_intout[3];                                            
  897.     *right_margin = vdi_intout[4];                                            
  898.     *hdpi = vdi_intout[5];                                                    
  899.     *vdpi = vdi_intout[6];                                                    
  900.  
  901.     return vdi_intout[0];
  902. }
  903.  
  904. long vq_max_color(int handle, COLOR_ENTRY *hilite_color)
  905. {
  906.     vdi_control[0] = 209;
  907.     vdi_control[1] = 0;
  908.     vdi_control[3] = 0;
  909.     vdi_control[5] = 2;
  910.     vdi_control[6] = handle;
  911.     vdi( &vdi_params );
  912.  
  913.     *hilite_color = *(COLOR_ENTRY *) &vdi_intout[2];
  914.     return( *(long *) vdi_intout );
  915. }
  916.  
  917. long vq_min_color(int handle, COLOR_ENTRY *hilite_color)
  918. {
  919.     vdi_control[0] = 209;
  920.     vdi_control[1] = 0;
  921.     vdi_control[3] = 0;
  922.     vdi_control[5] = 1;
  923.     vdi_control[6] = handle;
  924.     vdi( &vdi_params );
  925.  
  926.     *hilite_color = *(COLOR_ENTRY *) &vdi_intout[2];
  927.     return( *(long *) vdi_intout );
  928. }
  929.  
  930. long vq_prn_scaling(int handle)
  931. {
  932.     vdi_intin[0] = -1;
  933.     vdi_intin[1] = -1;
  934.  
  935.     vdi_control[0] = 5;
  936.     vdi_control[1] = 0;
  937.     vdi_control[3] = 2;
  938.     vdi_control[4] = 0;
  939.     vdi_control[5] = 39;
  940.     vdi_control[6] = handle;
  941.  
  942.     vdi(&vdi_params);
  943.     
  944.     if (vdi_control[4] == 2)                                                
  945.         return (*(long *) vdi_intout);
  946.     else
  947.         return -1L;
  948. }
  949.  
  950. long vq_px_format(int handle, unsigned long *px_format)
  951. {
  952.     vdi( &vdi_params );
  953.     vdi_control[0] = 204;
  954.     vdi_control[1] = 0;
  955.     vdi_control[3] = 0;
  956.     vdi_control[5] = 3;
  957.     vdi_control[6] = handle;
  958.  
  959.     *px_format = *(unsigned long *) &vdi_intout[2];
  960.     return (*(long*) &vdi_intout[0]);
  961. }
  962.  
  963. long vq_weight_color(int handle, COLOR_ENTRY *hilite_color)
  964. {
  965.     vdi_control[0] = 209;
  966.     vdi_control[1] = 0;
  967.     vdi_control[3] = 0;
  968.     vdi_control[5] = 3;
  969.     vdi_control[6] = handle;
  970.     vdi( &vdi_params );
  971.  
  972.     *hilite_color = *(COLOR_ENTRY *) &vdi_intout[2];
  973.     return( *(long *) vdi_intout );
  974. }
  975.  
  976. long vqf_bg_color(int handle, COLOR_ENTRY *fg_color)
  977. {
  978.     vdi_control[0] = 203;
  979.     vdi_control[1] = 0;
  980.     vdi_control[3] = 0;
  981.     vdi_control[5] = 1;
  982.     vdi_control[6] = handle;
  983.     vdi(&vdi_params);
  984.  
  985.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  986.     return (*(long*) &vdi_intout[0]);
  987. }
  988.  
  989. long vqf_fg_color(int handle, COLOR_ENTRY *fg_color)
  990. {
  991.     vdi_control[0] = 202;
  992.     vdi_control[1] = 0;
  993.     vdi_control[3] = 0;
  994.     vdi_control[5] = 1;
  995.     vdi_control[6] = handle;
  996.     vdi(&vdi_params);
  997.  
  998.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  999.     return (*(long*) &vdi_intout[0]);
  1000. }
  1001.  
  1002. long vql_bg_color(int handle, COLOR_ENTRY *fg_color)
  1003. {
  1004.     vdi_control[0] = 203;
  1005.     vdi_control[1] = 0;
  1006.     vdi_control[3] = 0;
  1007.     vdi_control[5] = 2;
  1008.     vdi_control[6] = handle;
  1009.     vdi(&vdi_params);
  1010.  
  1011.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1012.     return (*(long*) &vdi_intout[0]);
  1013. }
  1014.  
  1015. long vql_fg_color(int handle, COLOR_ENTRY *fg_color)
  1016. {
  1017.     vdi_control[0] = 202;
  1018.     vdi_control[1] = 0;
  1019.     vdi_control[3] = 0;
  1020.     vdi_control[5] = 2;
  1021.     vdi_control[6] = handle;
  1022.     vdi(&vdi_params);
  1023.  
  1024.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1025.     return (*(long*) &vdi_intout[0]);
  1026. }
  1027.  
  1028. long vqm_bg_color(int handle, COLOR_ENTRY *fg_color)
  1029. {
  1030.     vdi_control[0] = 203;
  1031.     vdi_control[1] = 0;
  1032.     vdi_control[3] = 0;
  1033.     vdi_control[5] = 3;
  1034.     vdi_control[6] = handle;
  1035.     vdi(&vdi_params);
  1036.  
  1037.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1038.     return (*(long*) &vdi_intout[0]);
  1039. }
  1040.  
  1041. long vqm_fg_color(int handle, COLOR_ENTRY *fg_color)
  1042. {
  1043.     vdi_control[0] = 202;
  1044.     vdi_control[1] = 0;
  1045.     vdi_control[3] = 0;
  1046.     vdi_control[5] = 3;
  1047.     vdi_control[6] = handle;
  1048.     vdi(&vdi_params);
  1049.  
  1050.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1051.     return (*(long*) &vdi_intout[0]);
  1052. }
  1053.  
  1054. long vqr_bg_color(int handle, COLOR_ENTRY *fg_color)
  1055. {
  1056.     vdi_control[0] = 203;
  1057.     vdi_control[1] = 0;
  1058.     vdi_control[3] = 0;
  1059.     vdi_control[5] = 4;
  1060.     vdi_control[6] = handle;
  1061.     vdi(&vdi_params);
  1062.  
  1063.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1064.     return (*(long*) &vdi_intout[0]);
  1065. }
  1066.  
  1067. long vqr_fg_color(int handle, COLOR_ENTRY *fg_color)
  1068. {
  1069.     vdi_control[0] = 202;
  1070.     vdi_control[1] = 0;
  1071.     vdi_control[3] = 0;
  1072.     vdi_control[5] = 4;
  1073.     vdi_control[6] = handle;
  1074.     vdi(&vdi_params);
  1075.  
  1076.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1077.     return (*(long*) &vdi_intout[0]);
  1078. }
  1079.  
  1080. long vqt_bg_color(int handle, COLOR_ENTRY *fg_color)
  1081. {
  1082.     vdi_control[0] = 203;
  1083.     vdi_control[1] = 0;
  1084.     vdi_control[3] = 0;
  1085.     vdi_control[5] = 0;
  1086.     vdi_control[6] = handle;
  1087.     vdi(&vdi_params);
  1088.  
  1089.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1090.     return (*(long*) &vdi_intout[0]);
  1091. }
  1092.  
  1093. long vqt_fg_color(int handle, COLOR_ENTRY *fg_color)
  1094. {
  1095.     vdi_control[0] = 202;
  1096.     vdi_control[1] = 0;
  1097.     vdi_control[3] = 0;
  1098.     vdi_control[5] = 0;
  1099.     vdi_control[6] = handle;
  1100.     vdi(&vdi_params);
  1101.  
  1102.     *fg_color = *(COLOR_ENTRY *) &vdi_intout[2];
  1103.     return (*(long*) &vdi_intout[0]);
  1104. }
  1105.  
  1106. void vr_transfer_bits(int handle, GCBITMAP *src_bm, GCBITMAP *dst_bm, int *src_rect, int *dst_rect, int mode)
  1107. {
  1108.     vdi_intin[0] = mode;
  1109.     vdi_intin[1] = 0;
  1110.     vdi_intin[2] = 0;
  1111.     vdi_intin[3] = 0;
  1112.  
  1113.     vdi_ptsin[0] = src_rect[0];
  1114.     vdi_ptsin[1] = src_rect[1];
  1115.     vdi_ptsin[2] = src_rect[2];
  1116.     vdi_ptsin[3] = src_rect[3];
  1117.  
  1118.     vdi_ptsin[4] = dst_rect[0];
  1119.     vdi_ptsin[5] = dst_rect[1];
  1120.     vdi_ptsin[6] = dst_rect[2];
  1121.     vdi_ptsin[7] = dst_rect[3];
  1122.  
  1123.     *(GCBITMAP **) &vdi_control[7] = src_bm;
  1124.     *(GCBITMAP **) &vdi_control[9] = dst_bm;
  1125.     *(GCBITMAP **) &vdi_control[11] = 0L;
  1126.     
  1127.     vdi_control[0] = 170;
  1128.     vdi_control[1] = 4;
  1129.     vdi_control[3] = 4;
  1130.     vdi_control[5] = 0;
  1131.     vdi_control[6] = handle;
  1132.     vdi(&vdi_params);
  1133. }
  1134.  
  1135. int vs_ctab(int handle, COLOR_TAB *ctab)
  1136. {
  1137.     vdi_params.intin = (short *)ctab;
  1138.  
  1139.     vdi_control[0] = 205;
  1140.     vdi_control[1] = 0;
  1141.     vdi_control[3] = (short)(ctab->length / 2);
  1142.     vdi_control[5] = 0;
  1143.     vdi_control[6] = handle;
  1144.     vdi(&vdi_params);
  1145.  
  1146.     vdi_params.intin = vdi_intin;
  1147.  
  1148.     return (vdi_intout[0]);
  1149. }
  1150.  
  1151. int vs_ctab_entry(int handle, int index, long color_space, COLOR_ENTRY *color)
  1152. {
  1153.     vdi_intin[0] = index;
  1154.     *(long *) &vdi_intin[1] = color_space;
  1155.     *(COLOR_ENTRY *) &vdi_intin[3] = *color;
  1156.  
  1157.     vdi_control[0] = 205;
  1158.     vdi_control[1] = 0;
  1159.     vdi_control[3] = 7;
  1160.     vdi_control[5] = 1;
  1161.     vdi_control[6] = handle;
  1162.     vdi( &vdi_params );
  1163.  
  1164.     return vdi_intout[0];
  1165. }
  1166.  
  1167. int vs_dflt_ctab(int handle)
  1168. {
  1169.     vdi_control[0] = 205;
  1170.     vdi_control[1] = 0;
  1171.     vdi_control[3] = 0;
  1172.     vdi_control[5] = 2;
  1173.     vdi_control[6] = handle;
  1174.     vdi(&vdi_params);
  1175.  
  1176.     return vdi_intout[0];
  1177. }
  1178.  
  1179. int vs_document_info(int vdi_handle, int type, char *s, int wchar)
  1180. {
  1181.     int    cnt;
  1182.  
  1183.     vdi_intout[0] = 0;
  1184.     vdi_intin[0] = type;
  1185.     if (wchar)
  1186.     {
  1187.         /* 16bit strings not yet supported! */
  1188.         return 0;
  1189.     }
  1190.     else
  1191.         cnt = vdi_str2array(s, vdi_intin+1);
  1192.  
  1193.     vdi_control[0] = 5;
  1194.     vdi_control[1] = 0;
  1195.     vdi_control[3] = 1 + cnt;
  1196.     vdi_control[5] = 2103;
  1197.     vdi_control[6] = vdi_handle;
  1198.     vdi(&vdi_params);
  1199.     return vdi_intout[0];
  1200. }
  1201.  
  1202. int vs_hilite_color(int handle, long color_space, COLOR_ENTRY *hilite_color)
  1203. {
  1204.     *(long *) &vdi_intin[0] = color_space;
  1205.     *(COLOR_ENTRY *) &vdi_intin[2] = *hilite_color;
  1206.  
  1207.     vdi_control[0] = 207;
  1208.     vdi_control[1] = 0;
  1209.     vdi_control[3] = 6;
  1210.     vdi_control[5] = 0;
  1211.     vdi_control[6] = handle;
  1212.     vdi(&vdi_params);
  1213.  
  1214.     return vdi_intout[0];
  1215. }
  1216.  
  1217. int vs_max_color(int handle, long color_space, COLOR_ENTRY *min_color)
  1218. {
  1219.     *(long *) &vdi_intin[0] = color_space;
  1220.     *(COLOR_ENTRY *) &vdi_intin[2] = *min_color;
  1221.  
  1222.     vdi_control[0] = 207;
  1223.     vdi_control[1] = 0;
  1224.     vdi_control[3] = 6;
  1225.     vdi_control[5] = 2;
  1226.     vdi_control[6] = handle;
  1227.     vdi(&vdi_params);
  1228.  
  1229.     return vdi_intout[0];
  1230. }
  1231.  
  1232. int vs_min_color(int handle, long color_space, COLOR_ENTRY *min_color)
  1233. {
  1234.     *(long *) &vdi_intin[0] = color_space;
  1235.     *(COLOR_ENTRY *) &vdi_intin[2] = *min_color;
  1236.  
  1237.     vdi_control[0] = 207;
  1238.     vdi_control[1] = 0;
  1239.     vdi_control[3] = 6;
  1240.     vdi_control[5] = 1;
  1241.     vdi_control[6] = handle;
  1242.     vdi(&vdi_params);
  1243.  
  1244.     return vdi_intout[0];
  1245. }
  1246.  
  1247. int vs_weight_color(int handle, long color_space, COLOR_ENTRY *weight_color)
  1248. {
  1249.     *(long *) &vdi_intin[0] = color_space;
  1250.     *(COLOR_ENTRY *) &vdi_intin[2] = *weight_color;
  1251.  
  1252.     vdi_control[0] = 207;
  1253.     vdi_control[1] = 0;
  1254.     vdi_control[3] = 6;
  1255.     vdi_control[5] = 3;
  1256.     vdi_control[6] = handle;
  1257.     vdi(&vdi_params);
  1258.  
  1259.     return vdi_intout[0];
  1260. }
  1261.  
  1262. int vsf_bg_color(int handle, long color_space, COLOR_ENTRY *bg_color)
  1263. {
  1264.     *(long *) &vdi_intin[0] = color_space;
  1265.     *(COLOR_ENTRY *) &vdi_intin[2] = *bg_color;
  1266.  
  1267.     vdi_control[0] = 201;
  1268.     vdi_control[1] = 0;
  1269.     vdi_control[3] = 6;
  1270.     vdi_control[5] = 1;
  1271.     vdi_control[6] = handle;
  1272.     vdi(&vdi_params );
  1273.  
  1274.     return vdi_intout[0];
  1275. }
  1276.  
  1277. int vsf_fg_color(int handle, long color_space, COLOR_ENTRY *fg_color)
  1278. {
  1279.     *(long *) &vdi_intin[0] = color_space;
  1280.     *(COLOR_ENTRY *) &vdi_intin[2] = *fg_color;
  1281.  
  1282.     vdi_control[0] = 200;
  1283.     vdi_control[1] = 0;
  1284.     vdi_control[3] = 6;
  1285.     vdi_control[5] = 1;
  1286.     vdi_control[6] = handle;
  1287.     vdi(&vdi_params );
  1288.  
  1289.     return vdi_intout[0];
  1290. }
  1291.  
  1292. int vsl_bg_color(int handle, long color_space, COLOR_ENTRY *bg_color)
  1293. {
  1294.  
  1295.     *(long *) &vdi_intin[0] = color_space;
  1296.     *(COLOR_ENTRY *) &vdi_intin[2] = *bg_color;
  1297.  
  1298.     vdi_control[0] = 201;
  1299.     vdi_control[1] = 0;
  1300.     vdi_control[3] = 6;
  1301.     vdi_control[5] = 2;
  1302.     vdi_control[6] = handle;
  1303.     vdi(&vdi_params);
  1304.  
  1305.     return vdi_intout[0];
  1306. }
  1307.  
  1308. int vsl_fg_color(int handle, long color_space, COLOR_ENTRY *fg_color)
  1309. {
  1310.  
  1311.     *(long *) &vdi_intin[0] = color_space;
  1312.     *(COLOR_ENTRY *) &vdi_intin[2] = *fg_color;
  1313.  
  1314.     vdi_control[0] = 200;
  1315.     vdi_control[1] = 0;
  1316.     vdi_control[3] = 6;
  1317.     vdi_control[5] = 2;
  1318.     vdi_control[6] = handle;
  1319.     vdi(&vdi_params);
  1320.  
  1321.     return vdi_intout[0];
  1322. }
  1323.  
  1324. int vsm_bg_color(int handle, long color_space, COLOR_ENTRY *bg_color)
  1325. {
  1326.     *(long *) &vdi_intin[0] = color_space;
  1327.     *(COLOR_ENTRY *) &vdi_intin[2] = *bg_color;
  1328.  
  1329.     vdi_control[0] = 201;
  1330.     vdi_control[1] = 0;
  1331.     vdi_control[3] = 6;
  1332.     vdi_control[5] = 3;
  1333.     vdi_control[6] = handle;
  1334.     vdi(&vdi_params);
  1335.  
  1336.     return vdi_intout[0];
  1337. }
  1338.  
  1339. int vsm_fg_color(int handle, long color_space, COLOR_ENTRY *fg_color)
  1340. {
  1341.     *(long *) &vdi_intin[0] = color_space;
  1342.     *(COLOR_ENTRY *) &vdi_intin[2] = *fg_color;
  1343.  
  1344.     vdi_control[0] = 200;
  1345.     vdi_control[1] = 0;
  1346.     vdi_control[3] = 6;
  1347.     vdi_control[5] = 3;
  1348.     vdi_control[6] = handle;
  1349.     vdi(&vdi_params);
  1350.  
  1351.     return vdi_intout[0];
  1352. }
  1353.  
  1354. int vsr_bg_color(int handle, long color_space, COLOR_ENTRY *bg_color)
  1355. {
  1356.     *(long *) &vdi_intin[0] = color_space;
  1357.     *(COLOR_ENTRY *) &vdi_intin[2] = *bg_color;
  1358.  
  1359.     vdi_control[0] = 201;
  1360.     vdi_control[1] = 0;
  1361.     vdi_control[3] = 6;
  1362.     vdi_control[5] = 4;
  1363.     vdi_control[6] = handle;
  1364.     vdi(&vdi_params);
  1365.  
  1366.     return vdi_intout[0];
  1367. }
  1368.  
  1369. int vsr_fg_color(int handle, long color_space, COLOR_ENTRY *fg_color)
  1370. {
  1371.     *(long *) &vdi_intin[0] = color_space;
  1372.     *(COLOR_ENTRY *) &vdi_intin[2] = *fg_color;
  1373.  
  1374.     vdi_control[0] = 200;
  1375.     vdi_control[1] = 0;
  1376.     vdi_control[3] = 6;
  1377.     vdi_control[5] = 4;
  1378.     vdi_control[6] = handle;
  1379.     vdi(&vdi_params);
  1380.  
  1381.     return vdi_intout[0];
  1382. }
  1383.  
  1384. int vst_bg_color(int handle, long color_space, COLOR_ENTRY *bg_color)
  1385. {
  1386.     *(long *)&vdi_intin[0] = color_space;
  1387.     *(COLOR_ENTRY *)&vdi_intin[2] = *bg_color;
  1388.  
  1389.     vdi_control[0] = 201;
  1390.     vdi_control[1] = 0;
  1391.     vdi_control[3] = 6;
  1392.     vdi_control[5] = 0;
  1393.     vdi_control[6] = handle;
  1394.     vdi(&vdi_params);
  1395.  
  1396.     return vdi_intout[0];
  1397. }
  1398.  
  1399. int vst_fg_color(int handle, long color_space, COLOR_ENTRY *fg_color)
  1400. {
  1401.     *(long *)&vdi_intin[0] = color_space;
  1402.     *(COLOR_ENTRY *)&vdi_intin[2] = *fg_color;
  1403.  
  1404.     vdi_control[0] = 200;
  1405.     vdi_control[1] = 0;
  1406.     vdi_control[3] = 6;
  1407.     vdi_control[5] = 0;
  1408.     vdi_control[6] = handle;
  1409.     vdi(&vdi_params);
  1410.  
  1411.     return vdi_intout[0];
  1412. }
  1413.